package com.allwees.bs.module.core.dynamic.strategy;

import com.allwees.bs.module.core.dynamic.annotation.DynamicInject;
import com.allwees.bs.module.core.dynamic.data.DynamicInjectQuery;
import com.allwees.bs.module.core.dynamic.strategy.moudule.DynamicInjectCategoryFullnameStrategy;
import com.allwees.bs.module.core.dynamic.strategy.moudule.DynamicInjectLogisticsStrategy;
import com.allwees.bs.module.core.dynamic.strategy.moudule.DynamicInjectRetailerStrategy;
import com.allwees.bs.module.core.dynamic.strategy.moudule.DynamicInjectShippingAddressStrategy;
import com.allwees.bs.module.core.dynamic.strategy.moudule.DynamicInjectSkuSnapStrategy;
import com.allwees.bs.module.core.dynamic.strategy.moudule.DynamicInjectStoreStrategy;
import com.allwees.bs.module.core.dynamic.strategy.moudule.DynamicInjectUserStrategy;

import java.util.HashMap;
import java.util.Map;

public abstract class DynamicInjectStrategy {

    public abstract Object inject(String key, Object target);

    public abstract void setQuery(DynamicInjectQuery query);

    public static Map<DynamicInject.Type, DynamicInjectStrategy> strategy = new HashMap<>();

    static {
        strategy.put(DynamicInject.Type.OrderItemSnap, new DynamicInjectSkuSnapStrategy());
        strategy.put(DynamicInject.Type.Store, new DynamicInjectStoreStrategy());
        strategy.put(DynamicInject.Type.Retailer, new DynamicInjectRetailerStrategy());
        strategy.put(DynamicInject.Type.Logistics, new DynamicInjectLogisticsStrategy());
        strategy.put(DynamicInject.Type.ShippingAddress, new DynamicInjectShippingAddressStrategy());
        strategy.put(DynamicInject.Type.User, new DynamicInjectUserStrategy());
        strategy.put(DynamicInject.Type.Category, new DynamicInjectCategoryFullnameStrategy());
    }
}
